#include "Render.h"


TextRender::TextRender()
{
	//m_Font = new FTPixmapFont("C:\\Windows\\Fonts\\msyh.ttf");
	m_Font = new FTBitmapFont("C:\\Windows\\Fonts\\msyh.ttf");

	// If something went wrong, bail out.
	if(m_Font->Error())
		printf("Font error!");

	// Set the font size and render a small text.
	m_Font->FaceSize(72);
}

void TextRender::RenderNumber(int n)
{

}

void TextRender::RenderChar(char c)
{

}

void TextRender::SetPoint(float x,float y,float z)
{
	m_Point1 = new FTPoint(x,y,z);
	m_Point2 = new FTPoint(x,y,z);
}

void TextRender::SetSize(int size)
{
	// Make sure size value is valid
	if(size > 0 && size <= 72)
		m_Font->FaceSize(size);
}

void TextRender::RenderWString(std::wstring wstr)
{
	const wchar_t* text = wstr.c_str();
	
	RenderWChar(text);
}

void TextRender::RenderWChar(const wchar_t* wchar)
{
	m_Font->Render(wchar);
}